package com.wy.panda.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.wy.panda.common.model.R;
import com.wy.panda.event.PandaEventPublisher;
import com.wy.panda.event.Test1ApplicationEvent;
import com.wy.panda.event.TestApplicationEvent;
import com.wy.panda.event.TestEvent.Test2ApplicationEvent;
import com.wy.panda.event.TestEvent.Test3ApplicationEvent;



/**
 * 菜单资源信息表
 *
 * @author wangyuan
 * @date 2020-09-11 23:46:39
 */
@RestController
@RequestMapping("/sys/menu")
public class SysMenuController extends BaseController {
    
    @Autowired
    private PandaEventPublisher pandaEventPublisher;
    
    @GetMapping(value = "/testEvent")
    public R<?> test() {
        pandaEventPublisher.publishEvent(new TestApplicationEvent("1"));
        pandaEventPublisher.publishEvent(new Test1ApplicationEvent("2"));
        pandaEventPublisher.publishEvent(Test2ApplicationEvent.build("22"));
        pandaEventPublisher.publishEvent(Test3ApplicationEvent.build("33"));
        return R.ok();
    }
}
